package com.controller.developerPortal;

import javax.servlet.ServletContext;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

/**
 * Handles requests for the application home page.
 */
@Controller
@RequestMapping("/demoForm/")
public class DemoController {
	    @Autowired
	    ServletContext context; 
	 @RequestMapping(value = "/", method = RequestMethod.GET)
	    public String index() {
	        return "demoForm";
	   		    }
	 
	 @RequestMapping(value = "/", method = RequestMethod.POST)
	    public String demoForm(String userName,String password, int docId,Model model){
		 	
		 	System.out.println(userName + "---" + password + "---" + docId);
		 	
		 	
		 	String message = "Some Error here!";
		 	model.addAttribute("message", message);
		 
			return "demoForm";
	   		    }
	   	
}
